<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>账户管理-我的银行卡</title>
<link rel="stylesheet" href="__PUBLIC__/Mobile/css/zhanghou.css">
<script src="__PUBLIC__/Mobile/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/Common/Layer/layer.js"></script>
<style>
	.foreach{
		width:80%;
		heighr:100px;
		font-size:14px;
		margin:10px auto;
		background-color:#ffffff;
		border-radius:10px;
	}
	.del{
		float:right;
		border-radius:10px;
		width:20px;
		height:20px;
		background-color:#ee6262;
		margin-right:5px;
		text-align: center;
		display: none;
	}
	.hover{
		width:85%;
		heighr:120px;
		font-size:14px;
		color:#ffffff;
		margin:10px auto;
		background-color:#33BC60;
		border-radius:10px;
		font-weight: bold;
	}
	 
</style>
</head>

<body>
<div class="lm">
	<a href="javascript:history.back(-1);">
		<img src="__PUBLIC__/Mobile/images/return.png" style="height:22px; padding-left:2%; line-height:22px; width:6%; padding-top:2%;" class="left">
	</a>
    <span class="left size20">我的银行卡 </span>
</div>
<section>
<!--我的银行卡-->
<div style="width:100%;margin:0 auto;text-algin:center;">
<foreach name="list" item="vo">
	<div class="foreach">
		<p style="text-indent:30px;padding-bottom:5px">{$vo.belong}<div onclick="del({$vo.id})" class="del">×</div></p>
		<p style="text-indent:30px;padding-bottom:5px">{$vo.type}</p>
		<p style="text-indent:30px;">{$vo.card_num}</p>
	</div>
</foreach>
<script>
	$(function(){
		$('.foreach').click(function(){
			$(this).siblings().removeClass("hover").end().addClass("hover");
			$(this).siblings().find('.del').css('display','none');
			$(this).find('.del').css('display','block');
		});
	})
</script>
<script>
function del(a){
	$.ajax({
		data:"id="+a,
		type:"POST",
		url:"{:U('Mycenter/bankcard_del')}",
		success:function(msg){
			console.log(msg);
			if(msg == 0){
				parent.layer.msg('解绑失败！',{icon:2,time:2000});
			}else{
				parent.layer.msg('解绑成功！',{icon:1,time:1000},function(){
					window.location.reload();
				});
			}
		}
	});
}
	// $(function(){
	// 	$('.del').click(function(){
	// 		var id = $('#id').val();
	// 		$.ajax({
	// 			data:"id="+id,
	// 			type:"POST",
	// 			url:"{:U('Mycenter/bankcard_del')}",
	// 			success:function(msg){
	// 				console.log(msg);
	// 				if(msg == 0){
	// 					parent.layer.msg('解绑失败！',{icon:2,time:2000});
	// 				}else{
	// 					parent.layer.msg('解绑成功！',{icon:1,time:1000},function(){
	// 						window.location.reload();
	// 					});
	// 				}
	// 			}
	// 		});
	// 	});
	// })
</script>
</div>
<div class="Bank-card">
<a href="{:U('Mycenter/bankcard_add')}">
	+添加银行卡
</a></div>
</section>

</body>
</html>
